package com.example.mystore.config;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {



    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id ="9021000138686285";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCd9NBL2Oy7miqYNpDxg0elJTv8yd+VYHu52ZHut8LpEvlnFLP4HWJLLMFkZZDiR4VNPXjUiQvb6ma+9DQ4UWZujrGTIT3dAFVPVz8NxvEYgcsXeLgAhxvAFBxFGyBWfQc7qhuq9Ex68FbKhpUUryaC1wVpb8p9y3MvKP5kB2jgN732a0sI4yzVXUYe+SfWlKnYK+p8QVq663C9T0SSX44Ak/1ebrLn2rtxMShFxMlwrJd4YOEfcSSlUYrfdV0G6Fj9mEcwL+2j4gfmzMlPlgI0LYplaH7fL/QszbdtSd/5zYwO9YU6VCRBrp3DeNf7npCHnGjJfaxZ2Yaq7VJcQbEbAgMBAAECggEBAIqS1xZjdbRT2OB2powqxvT8CHeKRytOXN08IcnSzx0Y91JWmFiotq4K0pMYg5XwduK/djzHCm9hYchOh22NBBcj+meAdzxmaXFUsk2M5cDBRYIO9yYHYfIN8osx9BnMUEcowmMlNd948Dt2/F0MF/YbW3UXjQb1MNUD2sG4umpROs3wAYgJM34B6Gjtj21Sy4iT5rdcB1Tm28PZSKC5zd1Vidwcq3DVvw4YRVX8UWc0/B25X9mR7VRgBxQHKWe6ysWVsUiGU0zky8PhZcFsLO5jRgmYf98cT3RU+0rY59RTVYhq98Y2qRa/ovOe26VhocrgSa/ReVNFKDYhg0UMwIkCgYEA2e7CGSvA1JhpQtgNfHo+pDGLD/u3vhBwifRGtlmfQrlK4gkuLlYRs4wVLumL/cxOLisajmJDghYJRJSB0ZwYvVqcfc4P1fvG1tgr2sRncwF+SCFC/0KsevTJ0jZ3n8M6hJFbBg1TqvgzdYZ4XISgP1beMcGAglUPQ4WpxbPDoj8CgYEAuYwbjoV7c5EmOhfe2U/HYEJEAwl8cVM0X9oKv6CUGGX/XxpA07q0F0d92lDbI3mz31Keuw7rW+xEnNCQDyEBItG2CtXBcxWm8zwaF5IEUPv6wlBDks28Xso9ZbzzCVa64VwpnDJfyLEzRHiIkbVwecA/q7E5wQK59ZXKS6cZQiUCgYEAv5e37IkarcyQPcPTl2uhRpiHuTWDBAVP6vhmckm4SeC8hJutje79AOxWcze/axECanRalHKvBt54p2In/y9MUKwoiDFwmp8O4DKL23hvuhvF+YPEcsUa/b3W8IgSAtKPz5w6ecedluE93ESr7Cps90JXdUa4w9wj3yjTaIvxoeECgYB2OMQyGfCfoOMnbqAp/D//oBkvijLFDgu36vigQlM5/HsrAFI/1Zz7nCyfFpeZ0eh+qWjDrOzfQ/ovpF+1lATiR5Zi7vF0P16BalEBpaKkavjKKFP1zKpyBw/5q9t6ns0x3AQTJrGK8QTGYro5hM6mdIzc+23eAbu0s30SmORqFQKBgQCT0p+rniH5uY9P7YOsdJS7mfoIg/1hpKafvWZ1SzsmxvdnonjIR1q7yG8FJQiSMjNPfNlAag7aQAeDauBylldPlQL6vEwl/U62xo4mPYxBVD8cvkAWwHBboUJHL+e6yW5EQVRmuLxvXHgpzfu3sbxQPOR/ULqXoy5HogccJBRhKA==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAh4wJf3K4z3B6R5SdI47PELG6JekvJcb+LlNGfdOzrU+tXi7EZHS7zR3nlFomNMQ02+ECGMVtE3WBbcS9RDKf0DHKd6Pg7HZEeDVKXPWad3/RkzPQV50s8xaJlLXoXBO1X3pYXoZrYcqhhGUWwtAsc3qf7gLgRjmsFBKYr7AmlTk8/ej2jw71UXFy6WrEGR0m2dVuvadOSKq8wZsznDzWUxzRKk1vQzs0HnILzHTaYEsMc8FElpIFIwe4wB4H5cxf1bG+CugcYPSUCr3BUUz5A+6BnF6nEv0yEkplHYl3I9auU6inelRN1+CYZ9n9PY7qFiAQ/gurvWYcdOMd7OlRswIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:8080/toPay/order";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问  return_url.jsp
    public static String return_url ="http://localhost:8080/toPay/order";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "\t\n" +
            "https://openapi-sandbox.dl.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

}
